import {BaseController} from './contorller/baseController.js';

//获得元素
let dropdown = document.querySelector('#dropdown');

//基础控制器
let controller = new BaseController();

//订阅事件
controller.subscribe('show-text', (e) => {
    let showText = document.getElementById('showText');
    showText.innerText = e.target.value;
})

//发布消息
dropdown.addEventListener('change', e => {
    console.log(dropdown.value);

    //发布消息
    controller.pubSub('show-text', e);
})